package com.atguigu.multiReading;
import java.util.Timer;
import java.util.TimerTask;

public class demo3 {
    public static void main(String[] args) {
        Timer timer=new Timer();
        timer.schedule(new TimerTask(){
            @Override
            public void run() {
                System.out.println("时间到，快学习");
            }
        },3000);
        System.out.println("开始计时");
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("时间到，去奥利给");
            }
        },4000);
    }
}
